﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microsoft.AspNet.SignalR;

namespace SignalRTest.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Second()
        {
            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();

            hubContext.Clients.All.addNewMessageToPage("系统管理员", "大家好" + DateTime.Now.ToString());
            return Content("成功");
        }
    }
}